
module.exports = 
	'all /main/tmpl/*': (req, res)->
		res.render 'main/tmpl/' +  req.params[0]

	'get /index' : (req, res)->
		res.render 'main/index'

	'get /': (req, res)->
		res.render 'main/index'

	'get /main/index': (req, res)->
		res.render 'main/index'
		
	'get /login': (req, res)->
		res.render 'login', {redirect: req.headers['referer']}

	'post /login': (req, res)->
		req.models.user.login req.body, (err)->
			res.redirect req.query.redirect